<template>
  <div class="qxz-content table-box">
    <el-table :data="tableData" border style="width: 100%" max-height="300px">
      <el-table-column prop="windSpeed" label="风速米/s" align="center">
      </el-table-column>
      <el-table-column prop="windDir" label="风向" align="center">
      </el-table-column>
      <el-table-column prop="humidity" label="温度" align="center">
      </el-table-column>
      <el-table-column prop="temperature" label="湿度" align="center">
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
import { onMounted } from "vue";
import echartsCom from "@/components/echarts.vue";
import * as echarts from "echarts";
const route = useRoute();
const props = defineProps({
  currentData: {
    type: Object,
    default: {},
  },
});
let tableData = ref([]);
const getData = async () => {
  try {
    tableData.value = [{ ...props.currentData }];
  } catch (e) {
    console.log("error:", e);
  }
};
watch(
  () => props.currentData,
  (newval) => {
    getData();
  },
  {
    deep: true,
    immediate: true,
  }
);

onMounted(() => {
  //   getData();
});
</script>

<style lang="scss">
.qxz-content {
  width: 450px;
  //   height: 275px;
  height: 25%;
  background: #ffffff;

  border-radius: 12px;
  margin-top: 10px;
  .event-name {
    font-family: PingFangSC, PingFang SC;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    display: flex;
    justify-content: space-between;
  }
}
.table-box {
  //   width: 100%;
  // height: 240px;
  // height: calc(100% - 40px);
  //   height: 100%;
}
.table-box {
  //   width: 450px;
  height: 100%;
  margin-top: 20px;
  .input-box {
    margin-bottom: 20px;
    width: 220px;
  }
  .el-input-group__append {
    background: #2263bf !important;
  }

  thead {
    .el-table__cell {
      background: rgba(142, 191, 255, 0.22) !important;
      color: #333333 !important;
      border-color: rgba(142, 191, 255, 0.22) !important;
    }
  }
  .el-table table {
    border-spacing: 0 0px !important;
  }
}
</style>
